import collections
from typing import List


class Solution:
    def halfQuestions(self, questions: List[int]) -> int:
        count = collections.Counter(questions)
        people = len(questions) // 2

        nums = count.most_common()

        ans = 0
        now = 0

        for i in range(len(nums)):
            ans += 1
            now += nums[i][1]
            if now >= people:
                return ans


if __name__ == "__main__":
    print(Solution().halfQuestions([2, 1, 6, 2]))  # 1
    print(Solution().halfQuestions([1, 5, 1, 3, 4, 5, 2, 5, 3, 3, 8, 6]))  # 2
